import { defineStore } from 'pinia'
const useZBStore = defineStore('ZB', {
    state: () => {
        return {
            token: '',
            userId: '',
            uId: '',
            list: ['马卡龙', '抹茶口味提拉米苏'],

            UseImg: '',
            userName: ''
        }
    },
    getters: {},
    // 存储token
    // 存储userId
    //存储uId ：店铺id
    actions: {
        setToken(payload) {
            this.token = payload
            localStorage.setItem('token', payload)
        },
        setUserId(payload) {
            this.userId = payload
            localStorage.setItem('userId', payload)
        },
        setUserName(payload) {
            this.userName = payload
            localStorage.setItem('userName', payload)
        },
        setUserImg(payload) {
            this.UseImg = payload
            localStorage.setItem('useImg', payload)
        },
        setUid(payload) {
            this.uId = payload
            localStorage.setItem('uId', payload)
        },
        removeToken() {
            this.token = ''
            this.userId = ''
            this.uId = ''
        }
    }
})
export default useZBStore